<template>
    <div class="ItemBox">
        <div>
            <!-- <input type="checkBox" :checked="ItemDAta.done" @change="handle" /> -->
            <el-checkbox v-model="ItemDAta.done"/>
            <span class="itemContext">{{ItemDAta.context}}</span>
        </div>
        <div class="button_ItemBox">
            <el-button size="mini" @click="handleModify">修改</el-button>
            <el-button  size="mini" type="danger" @click="deletedFn">删除</el-button>
        </div>
    </div>
</template>
<script>
export default {
    props:['ItemDAta','checktoDo','todoDeleteItem'],
    data() {
        return {
            
        }
    },
    methods:{
        deletedFn() {
            this.$emit('deletedFn',this.ItemDAta.id)
        },
        handle() {
            this.checktoDo(this.ItemDAta.id)
        },
        handleModify(){
            console.log("Item修改");
            this.$emit("modifyOpen",this.ItemDAta.id)
        }
    }
}
</script>
<style scoped>
.ItemBox{
    height: 30px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #d3d7d4;
    
}
.button_ItemBox{
    display: none;
    /* display: block; */
}
.ItemBox:hover{
    background-color: #77ac98;
}
.ItemBox:hover .button_ItemBox{
    display: block;
}
.itemContext {
    margin-left: 5px;
}
</style>